package com.getpebble.android.common.model;

import android.content.ContentValues;
import com.getpebble.android.common.core.trace.Trace;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class LockerAppsWrapper {
    private static final String TAG = LockerAppsWrapper.class.getSimpleName();
    @SerializedName("applications")
    public LockerApp[] lockerApps;

    public List<ContentValues> toContentValues() {
        if (this.lockerApps == null) {
            return Collections.EMPTY_LIST;
        }
        List<ContentValues> contentValuesList = new ArrayList(this.lockerApps.length);
        for (LockerApp lockerApp : this.lockerApps) {
            if (lockerApp.isValid()) {
                contentValuesList.add(lockerApp.toContentValues());
            } else {
                Trace.warning(TAG, "watchApp not valid: " + lockerApp);
            }
        }
        return contentValuesList;
    }
}
